-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix HiDPI scaling on X11 and XWayland (#88) #152
base: main
Are you sure you want to change the base?
Conversation
I should warn that it does mess up the layout somewhat. Here's how the unscaled window looks on my 4K monitor: Here's the window with the scaling patch. The layout is messed up a bit, but the text is readable and everything is crisp. And here's what happens if I multiply I assume you'll know what to do, though. For me, it's not a deal breaker. |
Added a PR on Maia-Everett:wayland-hidpi for changes to allow everything to scale. It was a bit too much to add as a series of comments, since it touches 22 files in all. I am encountering one oddity, though. When I check the scaling factor being applied, I'm getting 1.5875, despite having scaling set at 1.5 in kde. Not sure where it's getting that number. |
4a04bc6
to
d82df62
Compare
I've added verbose logging for that, and it seems SDL calculates DPI based on the physical dimensions of the screen. For my primary monitor, it reports 162.56x161.3647, whereas for scaling purposes I'd want 192 DPI reported (since my desktop uses 200% scaling with 4K resolution 3840x2160). Querying the desktop environment itself will return the value we actually want. And how do you obtain the scaling value the DE uses? Lol, lmao. By using a variety of DE-specific methods of various levels of hackishness, apparently. I'll change it. |
Just curious, is there nothing in Veldrid that can be used for that? |
Unfortunately, no. Grepping For KDE specifically, my plan is to query For GNOME and other DEs, I don't know a reliable way to query fractional scaling, so we can fall back to |
Pushed new commits:
Thanks for your scaling support, @rankynbass! The PR is now feature-complete. Here's how it looks at 200% scaling in KDE: and at 150%: This fix only applies to XWayland. Native Wayland rendering when running with |
Edit: I've reverted the native Wayland commit for now because it breaks mouse input. It's still in commit history if someone wants to work on top of that. For now, you can merge the XWayland changes, and we can look at native Wayland scaling later. |
9679bab
to
53d6bab
Compare
53d6bab
to
57797fa
Compare
I've fixed the native Wayland scaling fixes and pushed them to a separate branch: Maia-Everett/XIVLauncher.Core@wayland-hidpi...Maia-Everett:XIVLauncher.Core:wayland-native-hidpi I can make a separate PR after this is merged. I'll keep this PR focused on XWayland. |
I checked under KDE Plasma 6.1 with X11, and the scaling issue is present there too, so it's not just XWayland. |
Ensure that when running with the SDL X11 driver under Wayland, the window is correctly scaled (and is crisp rather than blurry).
See #88.